package vn.njai.thousand_english_word.Activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import butterknife.ButterKnife;
import butterknife.InjectView;
import vn.njai.thousand_english_word.R;

/**
 * Created by VUONG on 12/14/2014.
 */
public class AboutActivity extends ActionBarActivity {
    private String TAG = "AboutActivity";
    private Context mContext;

    @InjectView(R.id.toolbar) public Toolbar mToolbar;

    public static void start(Context context) {
        Intent intent = new Intent(context,AboutActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        mContext = getApplicationContext();
        init();
    }

    public void init(){
        ButterKnife.inject(this);
        initActionBar();
    }

    private void initActionBar(){
        mToolbar.setTitle(getString(R.string.actionbar_title_about));
        setSupportActionBar(mToolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_back);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle presses on the action bar items
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}
